
public class EmployeeHour extends Employee {

    private static final int WORKHOURS = 160;
    private double hourRate;

    public EmployeeHour(String name, double hourRate) {
        super(name);
        this.hourRate = hourRate;
    }

    public double calculateSalary() {
        double result = WORKHOURS * hourRate;
        return result;
    }

    @Override
    public String toString() {
        return "id: " + this.getId()
                + "\nName: " + this.getName()
                + "\nOccupations: " + this.getClass().getName()
                + "\nHour rate: " + this.getHourRate()
                + "\nMonthly pay: " + this.calculateSalary();
    }

    double getHourRate() {
        return this.hourRate;
    }
}
